CompleteTaskForm = function(config) {

    // Privatne varijable
    var privateVariable = '';

    this.valueData = {};
    this.formConfig = {};

    // Konfigruacija Window objekta se nalazi u this
    Ext.apply(this, config || {}, {
        title: 'Završi zadatak'
    });

    // Konfigruacija FormPanel objekta se nalazi u this.formConfig
    Ext.applyIf(this.formConfig, {
        monitorValid:true,
        items : [{
                    xtype: 'textarea',
                    fieldLabel: 'Napomena',
                    name:'bpmn_comment'
                }, {
                    xtype: 'textfield',
                    fieldLabel: 'Osoba',
                    allowBlank : false,
                    name:'bpmn_assignee'
                }, {
                    xtype : 'hidden',
                    name : 'bpmn_action'
                }, {
                    xtype : 'hidden',
                    name : 'taskId'
                }
        ],
        buttons: [{
                    text : 'Pošalji',
                    handler: this.formSubmit,
                    scale:'medium',
                    iconCls: 'button-form-upload',
                    formBind: true,
                    scope : this
                }, {
                    text : 'Odustani',
                    handler :this.close,
                    scale:'medium',
                    iconCls: 'button-form-cancel',
                    scope : this
                }
        ]
    });

    CompleteTaskForm.superclass.constructor.call(this);

};

Ext.extend(CompleteTaskForm, AbstractForm, {

    formSubmit : function(params, successCallback){
        this.getForm().submit( {
            url : 'mvc/task/form/complete',
            method : 'POST',
            scope : this,
            //params : params,
            success : this.close,
            //failure : function(){alert("Greška!");},
            waitTitle : 'Molim pričekajte',
            waitMsg : 'Spremam!',
            submitEmptyText : false,
            clientValidation : false
        });
    }

});

Ext.reg('completeTaskForm', CompleteTaskForm);